Optimal. Leaf size=401 \[ -\frac{n \text{PolyLog}\left (2,\frac{2 (a+b x) \left (c^2 h-c d g+d^2 f\right )}{(c+d x) \left (-\sqrt{g^2-4 f h} (b c-a d)+2 a c h-a d g-b c g+2 b d f\right )}\right )}{\sqrt{g^2-4 f h}}+\frac{n \text{PolyLog}\left (2,\frac{2 (a+b x) \left (c^2 h-c d g+d^2 f\right )}{(c+d x) \left (\sqrt{g^2-4 f h} (b c-a d)+2 a c h-a d g-b c g+2 b d f\right )}\right )}{\sqrt{g^2-4 f h}}-\frac{\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right ) \log \left (1-\frac{2 (a+b x) \left (c^2 h-c d g+d^2 f\right )}{(c+d x) \left (-\sqrt{g^2-4 f h} (b c-a d)+2 a c h-a d g-b c g+2 b d f\right )}\right )}{\sqrt{g^2-4 f h}}+\frac{\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right ) \log \left (1-\frac{2 (a+b x) \left (c^2 h-c d g+d^2 f\right )}{(c+d x) \left (\sqrt{g^2-4 f h} (b c-a d)+2 a c h-a d g-b c g+2 b d f\right )}\right )}{\sqrt{g^2-4 f h}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.51787, antiderivative size = 545, normalized size of antiderivative = 1.36, number of steps used = 19, number of rules used = 7, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.226, Rules used = {2513, 2418, 2394, 2393, 2391, 618, 206} \[ \frac{n \text{PolyLog}\left (2,\frac{2 h (a+b x)}{2 a h-b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{\sqrt{g^2-4 f h}}-\frac{n \text{PolyLog}\left (2,\frac{2 h (a+b x)}{2 a h-b \left (\sqrt{g^2-4 f h}+g\right )}\right )}{\sqrt{g^2-4 f h}}-\frac{n \text{PolyLog}\left (2,\frac{2 h (c+d x)}{2 c h-d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{\sqrt{g^2-4 f h}}+\frac{n \text{PolyLog}\left (2,\frac{2 h (c+d x)}{2 c h-d \left (\sqrt{g^2-4 f h}+g\right )}\right )}{\sqrt{g^2-4 f h}}+\frac{2 \tanh ^{-1}\left (\frac{g+2 h x}{\sqrt{g^2-4 f h}}\right ) \left (-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )+n \log (a+b x)-n \log (c+d x)\right )}{\sqrt{g^2-4 f h}}+\frac{n \log (a+b x) \log \left (-\frac{b \left (-\sqrt{g^2-4 f h}+g+2 h x\right )}{2 a h-b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{\sqrt{g^2-4 f h}}-\frac{n \log (a+b x) \log \left (-\frac{b \left (\sqrt{g^2-4 f h}+g+2 h x\right )}{2 a h-b \left (\sqrt{g^2-4 f h}+g\right )}\right )}{\sqrt{g^2-4 f h}}-\frac{n \log (c+d x) \log \left (-\frac{d \left (-\sqrt{g^2-4 f h}+g+2 h x\right )}{2 c h-d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{\sqrt{g^2-4 f h}}+\frac{n \log (c+d x) \log \left (-\frac{d \left (\sqrt{g^2-4 f h}+g+2 h x\right )}{2 c h-d \left (\sqrt{g^2-4 f h}+g\right )}\right )}{\sqrt{g^2-4 f h}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2513
Rule 2418
Rule 2394
Rule 2393
Rule 2391
Rule 618
Rule 206
Rubi steps
\begin{align*} \int \frac{\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )}{f+g x+h x^2} \, dx &=n \int \frac{\log (a+b x)}{f+g x+h x^2} \, dx-n \int \frac{\log (c+d x)}{f+g x+h x^2} \, dx-\left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \int \frac{1}{f+g x+h x^2} \, dx\\ &=n \int \left (\frac{2 h \log (a+b x)}{\sqrt{g^2-4 f h} \left (g-\sqrt{g^2-4 f h}+2 h x\right )}-\frac{2 h \log (a+b x)}{\sqrt{g^2-4 f h} \left (g+\sqrt{g^2-4 f h}+2 h x\right )}\right ) \, dx-n \int \left (\frac{2 h \log (c+d x)}{\sqrt{g^2-4 f h} \left (g-\sqrt{g^2-4 f h}+2 h x\right )}-\frac{2 h \log (c+d x)}{\sqrt{g^2-4 f h} \left (g+\sqrt{g^2-4 f h}+2 h x\right )}\right ) \, dx-\left (2 \left (-n \log (a+b x)+\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )+n \log (c+d x)\right )\right ) \operatorname{Subst}\left (\int \frac{1}{g^2-4 f h-x^2} \, dx,x,g+2 h x\right )\\ &=\frac{2 \tanh ^{-1}\left (\frac{g+2 h x}{\sqrt{g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{\sqrt{g^2-4 f h}}+\frac{(2 h n) \int \frac{\log (a+b x)}{g-\sqrt{g^2-4 f h}+2 h x} \, dx}{\sqrt{g^2-4 f h}}-\frac{(2 h n) \int \frac{\log (a+b x)}{g+\sqrt{g^2-4 f h}+2 h x} \, dx}{\sqrt{g^2-4 f h}}-\frac{(2 h n) \int \frac{\log (c+d x)}{g-\sqrt{g^2-4 f h}+2 h x} \, dx}{\sqrt{g^2-4 f h}}+\frac{(2 h n) \int \frac{\log (c+d x)}{g+\sqrt{g^2-4 f h}+2 h x} \, dx}{\sqrt{g^2-4 f h}}\\ &=\frac{2 \tanh ^{-1}\left (\frac{g+2 h x}{\sqrt{g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{\sqrt{g^2-4 f h}}+\frac{n \log (a+b x) \log \left (-\frac{b \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{2 a h-b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{\sqrt{g^2-4 f h}}-\frac{n \log (c+d x) \log \left (-\frac{d \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{2 c h-d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{\sqrt{g^2-4 f h}}-\frac{n \log (a+b x) \log \left (-\frac{b \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{2 a h-b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{\sqrt{g^2-4 f h}}+\frac{n \log (c+d x) \log \left (-\frac{d \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{2 c h-d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{\sqrt{g^2-4 f h}}-\frac{(b n) \int \frac{\log \left (\frac{b \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{-2 a h+b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{a+b x} \, dx}{\sqrt{g^2-4 f h}}+\frac{(b n) \int \frac{\log \left (\frac{b \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{-2 a h+b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{a+b x} \, dx}{\sqrt{g^2-4 f h}}+\frac{(d n) \int \frac{\log \left (\frac{d \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{-2 c h+d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{c+d x} \, dx}{\sqrt{g^2-4 f h}}-\frac{(d n) \int \frac{\log \left (\frac{d \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{-2 c h+d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{c+d x} \, dx}{\sqrt{g^2-4 f h}}\\ &=\frac{2 \tanh ^{-1}\left (\frac{g+2 h x}{\sqrt{g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{\sqrt{g^2-4 f h}}+\frac{n \log (a+b x) \log \left (-\frac{b \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{2 a h-b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{\sqrt{g^2-4 f h}}-\frac{n \log (c+d x) \log \left (-\frac{d \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{2 c h-d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{\sqrt{g^2-4 f h}}-\frac{n \log (a+b x) \log \left (-\frac{b \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{2 a h-b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{\sqrt{g^2-4 f h}}+\frac{n \log (c+d x) \log \left (-\frac{d \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{2 c h-d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{\sqrt{g^2-4 f h}}-\frac{n \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{2 h x}{-2 a h+b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{x} \, dx,x,a+b x\right )}{\sqrt{g^2-4 f h}}+\frac{n \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{2 h x}{-2 c h+d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{x} \, dx,x,c+d x\right )}{\sqrt{g^2-4 f h}}+\frac{n \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{2 h x}{-2 a h+b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{x} \, dx,x,a+b x\right )}{\sqrt{g^2-4 f h}}-\frac{n \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{2 h x}{-2 c h+d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{x} \, dx,x,c+d x\right )}{\sqrt{g^2-4 f h}}\\ &=\frac{2 \tanh ^{-1}\left (\frac{g+2 h x}{\sqrt{g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{\sqrt{g^2-4 f h}}+\frac{n \log (a+b x) \log \left (-\frac{b \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{2 a h-b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{\sqrt{g^2-4 f h}}-\frac{n \log (c+d x) \log \left (-\frac{d \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{2 c h-d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{\sqrt{g^2-4 f h}}-\frac{n \log (a+b x) \log \left (-\frac{b \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{2 a h-b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{\sqrt{g^2-4 f h}}+\frac{n \log (c+d x) \log \left (-\frac{d \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{2 c h-d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{\sqrt{g^2-4 f h}}+\frac{n \text{Li}_2\left (\frac{2 h (a+b x)}{2 a h-b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{\sqrt{g^2-4 f h}}-\frac{n \text{Li}_2\left (\frac{2 h (a+b x)}{2 a h-b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{\sqrt{g^2-4 f h}}-\frac{n \text{Li}_2\left (\frac{2 h (c+d x)}{2 c h-d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{\sqrt{g^2-4 f h}}+\frac{n \text{Li}_2\left (\frac{2 h (c+d x)}{2 c h-d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{\sqrt{g^2-4 f h}}\\ \end{align*}
Mathematica [A] time = 0.307974, size = 515, normalized size = 1.28 \[ \frac{-n \text{PolyLog}\left (2,\frac{b \left (\sqrt{g^2-4 f h}-g-2 h x\right )}{2 a h+b \left (\sqrt{g^2-4 f h}-g\right )}\right )+n \text{PolyLog}\left (2,\frac{b \left (\sqrt{g^2-4 f h}+g+2 h x\right )}{b \left (\sqrt{g^2-4 f h}+g\right )-2 a h}\right )+n \text{PolyLog}\left (2,\frac{d \left (\sqrt{g^2-4 f h}-g-2 h x\right )}{2 c h+d \sqrt{g^2-4 f h}+d (-g)}\right )-n \text{PolyLog}\left (2,\frac{d \left (\sqrt{g^2-4 f h}+g+2 h x\right )}{d \left (\sqrt{g^2-4 f h}+g\right )-2 c h}\right )+\log \left (-\sqrt{g^2-4 f h}+g+2 h x\right ) \log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-\log \left (\sqrt{g^2-4 f h}+g+2 h x\right ) \log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log \left (-\sqrt{g^2-4 f h}+g+2 h x\right ) \log \left (\frac{2 h (a+b x)}{2 a h+b \sqrt{g^2-4 f h}+b (-g)}\right )+n \log \left (\sqrt{g^2-4 f h}+g+2 h x\right ) \log \left (\frac{2 h (a+b x)}{2 a h-b \left (\sqrt{g^2-4 f h}+g\right )}\right )+n \log \left (-\sqrt{g^2-4 f h}+g+2 h x\right ) \log \left (\frac{2 h (c+d x)}{2 c h+d \sqrt{g^2-4 f h}+d (-g)}\right )-n \log \left (\sqrt{g^2-4 f h}+g+2 h x\right ) \log \left (\frac{2 h (c+d x)}{2 c h-d \left (\sqrt{g^2-4 f h}+g\right )}\right )}{\sqrt{g^2-4 f h}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 1.362, size = 0, normalized size = 0. \begin{align*} \int{\frac{1}{h{x}^{2}+gx+f}\ln \left ( e \left ({\frac{bx+a}{dx+c}} \right ) ^{n} \right ) }\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{\log \left (e \left (\frac{b x + a}{d x + c}\right )^{n}\right )}{h x^{2} + g x + f}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\log \left (e \left (\frac{b x + a}{d x + c}\right )^{n}\right )}{h x^{2} + g x + f}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]